package com.yixing.tech.common.convert;

import java.util.Optional;

public class IntegerToDoubleConverter implements Converter<Integer, Double> {

    @Override
    public Double convert(Integer source) {
        return Optional.ofNullable(source).map(Integer::doubleValue).orElse(null);
    }

    @Override
    public Class<Integer> getSourceType() {
        return Integer.class;
    }

    @Override
    public Class<Double> getTargetType() {
        return Double.class;
    }

}
